<!DOCTYPE html>
<html>
<head>
  <title>Test - Enum</title>
  <link rel="stylesheet" href="QUnit.css" type="text/css" />
  <script type="text/javascript" src="QUnit.js"></script>
  <script type="text/javascript" src="QUnitExt.js"></script>
</head>
<body>
  <h1 id="qunit-header">Test Results</h1>
  <h2 id="qunit-banner"></h2>
  <h2 id="qunit-userAgent"></h2>
  <ol id="qunit-tests"></ol>
  <br />
  <textarea id="qunit-log" rows="10" cols="100"></textarea>
</body>
<script type="text/javascript" src="..\..\bin\Debug\mscorlib.debug.js"></script>
<script type="text/javascript">
Type.registerNamespace('Test');

Test.Color = function() { };
Test.Color.prototype = {
  Red: 0,
  Green: 1,
  Blue: 2
};
Test.Color.registerEnum('Test.Color');

Test.Modes = function() { };
Test.Modes.prototype = {
  A: 1,
  B: 2,
  C: 4
};
Test.Modes.registerEnum('Test.Modes', true);

test('enum values', function() {
    QUnit.equal(Test.Color.Green, 1, 'Green should be 1');
});

test('flags enum values', function() {
    QUnit.equal(Test.Modes.B, 2, 'B should be 2');
    QUnit.equal(Test.Modes.B | Test.Modes.C, 6, 'B | C should be 6');
});
</script>
</html>
